package StudyCode.summary.mycollection;

import java.util.Collection;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class CollectionContainsAnyClassInstance {
	public static boolean containsInstanceOf(Collection<?> collection, Class<?> type) {
		return collection.stream().anyMatch(element -> type.isAssignableFrom(element.getClass()));
	}
}
